var union={env:{},lib:{},ui:{},data:{},main:{client:{cooperation:{common:{},cpro:{},search:{},iknow:{},tuan:{}},register:{},settings:{media:{},site:{},channel:{},urlFilter:{},tradeFilter:{},backup:{}},user:{},initAccount:{},quality:{}},general:{register:{},retrieve:{}}},msg:{admin:{},client:{}},report:{client:{search:{},software:{},iknow:{},cpro:{},sp:{},app:{},dan:{},tuan:{}},admin:{search:{},software:{},iknow:{},cpro:{},sp:{},app:{},dan:{},tuan:{}}},cent:{client:{}},finance:{client:{}}};
union.lib.MainAction=(function(){var a=null;
return{enter:function(b){elf.dom.Event.add(window,"load",function(){a&&a.enter(b)
});
delete union.lib.MainAction.enter
},register:function(b){a=b
},getCurrent:function(){return a
}}
})();
union.lib.UIAction=elf.util.Class.create({initialize:function(a){union.lib.MainAction.register(this);
elf.util.extend(this,a)
},enter:function(a){var b=this;
this.context={};
elf.util.extend(this,a);
esui.util.init(document.body,this.UI_PROP_MAP);
this.onafterrender()
},onafterrender:new Function(),setContext:function(b,a){this.context[b]=a
},getContext:function(a){return this.context[a]
}});
union.lib.Ajax={loadJSON:function(b){var d=this;
var a=b.onSuccess;
b.responseType=elf.net.Ajax.DATA_TYPE_JSON;
b.onJSONError=function(f,e){alert("服务器返回数据错误或登录超时，请重新登录后再试。")
};
b.onSuccess=function(e){if(e.msg&&e.msg.length){alert(e.msg)
}if(e.status){b.onFail&&b.onFail(e);
return
}if(e.data){a&&a.call(b,e.data)
}setTimeout(union.lib.Support.initialize,0)
};
if(!b.noLoading){if(document.getElementById("AjaxLoading")){if(!this.mask){this.mask=new union.lib.Popup({moduleId:"AjaxLoading",backgroundId:"AjaxMask",center:true,updateDepth:true})
}if(++this.loadingCount){this.mask.show()
}}var c=b.onComplete;
b.onComplete=function(){c&&c.call(b);
if(document.getElementById("AjaxLoading")){if(!--d.loadingCount){d.mask.hide()
}}}
}elf.net.Ajax.load(b)
},loadingCount:0};
union.lib.AjaxForm=elf.util.Class.create({initialize:function(a){var c=this;
elf.util.extend(this,a);
var b=this.getForm();
b.onsubmit=function(){return c.submitForm()
};
b.onreset=function(){return c.onReset&&c.onReset()
}
},getForm:function(){return document.getElementById(this.formId)
},getFormData:function(){return this.constructor.getFormData(this.getForm())
},setFormData:function(b,a){this.constructor.setFormData(this.getForm(),b,a)
},handleFieldError:function(a){this.constructor.handleFieldError(a)
},resetFormError:function(){this.constructor.resetFormError(this.getForm())
},submitForm:function(){var c=this;
this.resetFormError();
var b=false;
if(this.validate?this.validate():true){b=true
}else{b=false
}if(b){this.resetFormError();
var a=this.getForm();
var d=this.getFormData();
union.lib.Ajax.loadJSON({url:a.action,method:a.method||elf.net.Ajax.HTTP_POST,data:d,onSuccess:function(e){if(e.fieldError){c.handleFieldError(e.fieldError)
}else{c.onSubmitSuccess&&c.onSubmitSuccess(e)
}}})
}return false
}});
elf.util.extend(union.lib.AjaxForm,{getFormData:function(d,c){var f=new elf.net.URLParameter();
var e=d.elements;
for(var b=e.length-1;
b>=0;
b--){var a=e[b];
f.add(this.getFieldData(a,c))
}return f
},getFieldData:function(g,c){if(elf.util.Type.isFunction(c)){return c(g)
}var d=new elf.net.URLParameter();
var i=g.name;
var b=g.value;
if(!g.disabled&&i){switch(g.type){case"radio":if(!g.checked){break
}case"textarea":case"text":case"password":case"hidden":case"select-one":d.set(i,b);
break;
case"checkbox":if(g.checked){d.add(i,b)
}break;
case"select-multiple":var a=g.options;
var f=a.length;
for(var h=0;
h<f;
h++){var e=a[h];
if(e.selected){d.add(i,e.value)
}}break
}}return d
},setFormData:function(e,f,d){for(var c in f){var b=e.elements[c];
if(b){if(b.length&&b.nodeType!=1){for(var a=b.length-1;
a>=0;
a--){this.setFieldValue(b[a],f[c],d)
}}else{this.setFieldValue(b,f[c],d)
}}}},setFieldValue:function(g,k,c){if(elf.util.Type.isFunction(c)){return c(g,k)
}var g=this.getField(g);
var k=elf.util.Type.isNull(k)||k=="null"?"":k;
if(k!=g.value&&g.length){for(var d=g.length-1;
d>=0;
d--){var h=g[d];
var b=h.value;
switch(h.type){case"radio":case"checkbox":h.checked=k==b;
break;
case"textarea":case"text":case"password":case"hidden":h.value=k;
break;
case"select-one":union.lib.Combobox.selectByValue(h,k);
break;
case"select-multiple":var a=h.options;
var f=a.length;
for(var j=0;
j<f;
j++){var e=a[j];
a[j].selected=e.value==k
}break
}}}},getField:function(a){return elf.util.Type.isString(a)?document.getElementsByName(a):a instanceof Array?a:[a]
},getFieldInfoBlock:function(e){var c=[];
var a=this.getField(e);
var g=false;
for(var d=a.length-1;
d>=0;
d--){for(var f=a[d].parentNode;
f;
f=f.parentNode){if(elf.dom.ClassName.has(f,"input-bar")){g=true;
break
}}if(g){c.push(f)
}}for(var d=c.length-1;
d>=0;
d--){for(var b=d-1;
b>=0;
b--){if(c[b]==c[d]){c.splice(d,1)
}}}return c
},handleFieldError:function(e){var d=e;
if(elf.util.Type.isObject(e)&&!(e instanceof Array)){d=[];
for(var b in e){d.push({field:b,error:e[b]})
}}for(var b=0,a=d.length;
b<a;
b++){var c=d[b];
this.setFieldError(c.field,c.error)
}},setFieldInfo:function(g,b,f){var h=this.getFieldInfoBlock(g);
var e=elf.util.Type.isDefined(f)?f instanceof Array?f.join("<br />"):f+"":"";
for(var a=h.length-1;
a>=0;
a--){var d=elf.dom.query("."+b,h[a])[0];
if(d){d.innerHTML=e
}var c=h[a].getAttribute("status");
c&&elf.dom.ClassName.remove(h[a],c);
if(e){elf.dom.ClassName.add(h[a],b);
h[a].setAttribute("status",b)
}}},setFieldError:function(b,a){this.setFieldInfo(b,this.INFO_TYPE_ERROR,a)
},setFieldSuccess:function(b,a){this.setFieldInfo(b,this.INFO_TYPE_SUCCESS,a)
},resetFormError:function(b){for(var a=b.elements.length-1;
a>=0;
a--){this.setFieldError(b.elements[a],[])
}},disableFieldSet:function(d,c){var a=elf.dom.query("input",d).concat(elf.dom.query("select",d)).concat(elf.dom.query("textarea",d));
for(var b=a.length-1;
b>=0;
b--){a[b].disabled=c
}},disableField:function(c,b){var c=elf.util.Type.isString(c)?document.getElementsByName(c):c instanceof Array?c:[c];
for(var a=c.length-1;
a>=0;
a--){c[a].disabled=b
}},setErrorFieldFocus:function(d){if(d.length){var a=this.getField(d[0].field);
for(var c=a.length-1;
c>=0;
c--){var b=a[c];
if(elf.dom.isVisible(b)&&b.type!="hidden"){b.focus()
}}}},INFO_TYPE_HINT:"hint",INFO_TYPE_ERROR:"error",INFO_TYPE_SUCCESS:"success"});
union.lib.CheckGroup=elf.util.Class.create({initialize:function(a){var c=this;
var b=this.constructor;
elf.util.extend(this,b.option);
elf.util.extend(this,a);
elf.dom.Event.add(this.getWrap(),"click",function(d){c.onChange&&c.onChange(c.getValue())
},function(d){return d.type==c.type
})
},getWrap:function(){return document.getElementById(this.wrapId)
},getGroup:function(){return elf.dom.query("input[type="+this.type+"]",this.getWrap())
},getChecked:function(a){return this.constructor.getChecked(this.getGroup(),a)
},getValue:function(a){return this.constructor.getValue(this.getGroup(),a)
},getAllValue:function(){return this.constructor.getAllValue(this.getGroup(),getDisabled)
},checkByValue:function(b,a){return this.constructor.checkByValue(this.getGroup(),b,a)
},checkByIndex:function(a,b){return this.constructor.checkByIndex(this.getGroup(),a,b)
},checkAll:function(a){return this.constructor.checkAll(this.getGroup(),a)
},checkDefault:function(){if(this.defaultCheckIndex>=0){this.checkByIndex(this.defaultCheckIndex);
this.onChange&&this.onChange(this.getValue())
}}});
elf.util.extend(union.lib.CheckGroup,{TYPE_CHECKBOX:"checkbox",TYPE_RADIO:"radio",getChecked:function(e,a){var c=[];
for(var d=e.length-1;
d>=0;
d--){var b=e[d];
if(b.checked&&(!b.disabled||a)){c.unshift(b)
}}return c.length?c.length>1?c:c[0]:null
},getValue:function(e,a){var d=[];
for(var c=e.length-1;
c>=0;
c--){var b=e[c];
if(b.checked&&(a||!b.disabled)&&b.value){d.unshift(b.value)
}}return d.length?(d.length>1?d:d[0]):""
},getAllValue:function(e,a){var d=[];
for(var c=e.length-1;
c>=0;
c--){var b=e[c];
if(a||!b.disabled){d.unshift(b.value||"")
}}return d
},checkByValue:function(h,g,e){var g=g instanceof Array?g:[g];
var a=true;
var d=0;
for(var c=h.length-1;
c>=0;
c--){var f=false;
for(var b=g.length-1;
b>=0;
b--){if(h[c].value==g[b]){f=true;
d++;
break
}else{if(e){f=false
}}}h[c].checked=f;
if(a&&!f){a=false
}}return a?-1:d
},checkByIndex:function(h,c,f){var c=c instanceof Array?c:[c];
var a=true;
var e=0;
for(var d=h.length-1;
d>=0;
d--){for(var b=c.length-1;
b>=0;
b--){var g=false;
if(d==c[b]){g=true;
e++
}else{if(f){g=false
}}h[d].checked=g;
if(a&&!g){a=false
}}}return a?-1:e
},checkAll:function(c,a){if(this.type==this.constructor.TYPE_CHECKBOX){for(var b=c.length-1;
b>=0;
b--){c[b].checked=a
}}}});
union.lib.CheckGroup.option={type:union.lib.CheckGroup.TYPE_CHECKBOX};
union.lib.ColorPicker=elf.util.Class.create({initialize:function(c){var f=this;
var e=this.constructor;
elf.util.extend(this,c);
if(!e.ready){e.initialize()
}var d=this.getButton();
if(d){d.onclick=function(){f.showPanel()
}
}var b=this.getInput();
if(b){b.onchange=function(){var g=this.value;
if(elf.validation.Verifier.isHexRGBColor(g)){f.changeColor(g)
}else{f.onInputError&&f.onInputError(g)
}}
}var a=b&&b.value||this.color;
if(elf.util.Type.isDefined(a)){this.setColor(a)
}},getButton:function(){return document.getElementById(this.buttonId)
},getInput:function(){return document.getElementById(this.inputId)
},getColor:function(){return this.color
},setColor:function(a){this.color=a;
this.setButtonColor(a);
this.setInputColor(a)
},setButtonColor:function(a){var b=this.getButton();
if(b){b.style.backgroundColor="#"+a
}},setInputColor:function(b){var a=this.getInput();
if(a){a.value=b
}},changeColor:function(a){this.setColor(a);
this.onColorChange&&this.onColorChange(a)
},showPanel:function(){var b=this.constructor;
b.showing=this;
var a=this.getButton();
var c=elf.dom.getPosition(a,document.getElementById("MainPage"));
c.y+=a.offsetHeight;
b.showPanel(c)
}});
elf.util.extend(union.lib.ColorPicker,{ready:false,initialize:function(){var b=this;
this.pickerPanel=new union.lib.Popup({moduleId:"ECUIColorPickerPanel"});
var a=this.getPanel();
a.onconfirm=function(){b.changeColor(this.getColor().getRGB())
};
a.onhide=function(){b.hidePanel();
return false
};
this.ready=true
},getPanel:function(){ecui.get();
return elf.dom.query("#ECUIColorPickerPanel .ec-palette")[0].getControl()
},showPanel:function(b){var a=this;
this.getPanel().setColor(new ecui.Color(this.showing.color));
this.pickerPanel.position=b;
this.pickerPanel.showNoDelay();
elf.dom.Event.add(document,"click",function(d){var e=false;
for(var c=d.target;
c&&c!=document.body;
c=c.parentNode){if(c.id=="ECUIColorPickerPanel"||elf.dom.ClassName.has(c,"color-button")){e=true;
break
}}if(!e){elf.dom.Event.remove(document,"click",arguments.callee);
a.hidePanel()
}})
},hidePanel:function(){this.pickerPanel.hide()
},changeColor:function(a){if(this.showing){this.showing.changeColor(a)
}this.hidePanel()
}});
union.lib.Combobox=elf.util.Class.create({initialize:function(b){var c=this;
this.id=b.id;
this.defaultOption=b.defaultOption;
this.defaultSelectIndex=b.defaultSelectIndex;
var a=this.getDOM();
if(b.onChange){this.onChange=b.onChange
}a.onchange=function(d){var e=c.getValue();
var f=document.getElementById(this.getAttribute("data-mirror"));
if(f){f.value=e
}c.onChange&&c.onChange(e)
};
if(b.options){this.setOption(b.options)
}if(elf.util.Type.isDefined(b.defaultValue)){this.selectByValue(this.defaultValue=b.defaultValue)
}},getDOM:function(){return document.getElementById(this.id)
},getValue:function(){return this.getDOM().value
},getOptionLength:function(a){return this.getDOM().options.length-(this.defaultOption&&a?0:1)
},addOption:function(a){this.constructor.addOption(this.getDOM(),a)
},setOption:function(a){this.defaultOption&&a.unshift(this.defaultOption);
this.constructor.setOption(this.getDOM(),a);
this.getDOM().onchange()
},selectByValue:function(a){this.constructor.selectByValue(this.getDOM(),a)
},selectByIndex:function(a){this.constructor.selectByIndex(this.getDOM(),a)
},selectByText:function(a){this.constructor.selectByText(this.getDOM(),a)
},disable:function(a){this.constructor.disable(this.getDOM(),a)
},selectDefault:function(){var a=false;
switch(true){case this.defaultSelectIndex>=0:this.selectByIndex(this.defaultSelectIndex);
a=true;
break;
case elf.util.Type.isDefined(this.defaultValue):this.selectByValue(this.defaultValue);
a=true;
break;
default:break
}if(a){this.getDOM().onchange()
}}});
elf.util.extend(union.lib.Combobox,{addOption:function(b,c){var a=b.options.length;
var d=(b.options[a]=new Option(c.text,c.value));
if(c.selected){d.selected=true
}},setOption:function(b,c){b.options.length=0;
for(var d=0,a=c.length;
d<a;
d++){this.addOption(b,c[d])
}b=null
},selectByValue:function(a,c){for(var b=a.firstChild;
b;
b=b.nextSibling){if(b.nodeType==1&&b.value==c){b.selected=true
}}},selectByIndex:function(a,b){var c=a.options[b];
if(c){c.selected=true
}},selectByText:function(a,d){var c=a.options;
for(var b=c.length-1;
b>=0;
b--){c[b].selected=c[b].innerHTML==d
}},disable:function(c,a){c.disabled=!elf.util.Type.isUndefined(a)?a:!c.disabled
}});
union.lib.ComboboxGroup=elf.util.Class.create({initialize:function(a){var c=this;
this.listData=a.data;
this.treeData=this.constructor.toTreeJSON(a.data);
this.group=[];
this.defaultOption=a.defaultOption;
this.onChange=a.onChange;
for(var b=a.comboId.length-1;
b>=0;
b--){this.group.unshift(new union.lib.Combobox({id:a.comboId[b],defaultOption:this.defaultOption instanceof Array?this.defaultOption[b]:this.defaultOption}));
var d=this.group[0];
d.overlord=this;
if(this.group.length>1){d.next=this.group[1]
}d.onChange=function(){c._onChange.call(this);
c.onChange&&c.onChange(c.getValues())
}
}d.setOption(this.constructor.toListJSON(this.treeData))
},getDataItemByValue:function(e){var d={};
if(e){var a=[];
for(var b=e;
elf.util.Type.isDefined(b)&&b>0;
b=this.listData[b].parentId){a.push(b)
}if(a.length){for(var c=a.length-1,d=this.treeData;
c>=0;
c--){d=d[a[c]].children
}}}return d
},getLastValue:function(){var b="";
for(var a=this.group.length-1;
a>=0;
a--){b=this.group[a].getValue();
if(b){break
}}return b
},getValues:function(){var a=[];
for(var b=this.group.length-1;
b>=0;
b--){a.unshift(this.group[b].getValue())
}return a
},setValues:function(b){var a=b.length;
if(a<=this.group.length){for(var c=0;
c<a;
c++){var d=this.group[c];
d.selectByValue(b[c]);
this._onChange.call(d)
}this.onChange&&this.onChange(b)
}},setValueByLast:function(c){var a=[];
for(var b=c;
elf.util.Type.isDefined(b)&&this.listData[b];
b=this.listData[b].parentId){a.unshift(b)
}this.setValues(a)
},_onChange:function(){var a=this.next;
if(a){a.setOption(this.overlord.constructor.toListJSON(this.overlord.getDataItemByValue(this.getValue())));
elf.dom.ClassName.toggle(a.getDOM(),this.overlord.constructor.CLASS_OPTION_NULL,!a.getOptionLength());
a.onChange()
}}});
union.lib.ComboboxGroup.CLASS_OPTION_NULL="option-null";
union.lib.ComboboxGroup.toTreeJSON=function(g){var k={};
for(var f in g){var j=[];
for(var a=f;
(elf.util.Type.isDefined(a)||a>0)&&g[a];
a=g[a].parentId){j.push(a)
}for(var h=j.length-1,d=k;
h>=0;
h--){var b=j[h];
var e=d[b];
if(!e){e=d[b]={value:b};
elf.util.extend(d[b],g[b])
}if(!e.children){e.children={}
}d=e.children
}}return k
};
union.lib.ComboboxGroup.toListJSON=function(b){var c=[];
for(var a in b){c.push(b[a])
}return c
};
union.lib.Draggable=elf.util.Class.create({initialize:function(){}});
elf.util.extend(union.lib.Draggable,{UNIQUE_LABEL:elf.util.guid("data-dragging-id_"),dragging:{},start:function(c){var a=true;
for(var b in this.dragging){a=false
}if(a){elf.dom.Event.add(document,"mousemove",this.onDragging)
}if(c){var e=c.element.getAttribute(this.UNIQUE_LABEL);
if(!e){e=elf.util.guid();
c.element.setAttribute(this.UNIQUE_LABEL,e)
}var d=elf.dom.getPosition(c.element,document.documentElement);
c.originalPosition=c.element.style.position||"";
c.element.style.position="absolute";
c.startX=d.x;
c.startY=d.y;
c.offsetX=c.mouseX-d.x;
c.offsetY=c.mouseY-d.y;
this.dragging[e]=c
}return e
},onDragging:function(a){union.lib.Draggable.move(a.clientX,a.clientY)
},move:function(a,f){for(var b in this.dragging){var d=this.dragging[b];
var e=a-d.offsetX;
var c=f-d.offsetY;
d.element.style.left=e+"px";
d.element.style.top=c+"px"
}},stop:function(c){var e=c.getAttribute(this.UNIQUE_LABEL);
var d=this.dragging[e];
if(d){d.element.style.position=d.originalPosition;
d.element.setAttribute(this.UNIQUE_LABEL,"");
delete this.dragging[e]
}var a=true;
for(var b in this.dragging){a=false;
break
}if(a){elf.dom.Event.remove(document,"mousemove",this.onDragging)
}}});
union.lib.ExecQueue=elf.util.Class.create({initialize:function(a){elf.util.extend(this,a);
this.autoStart&&this.start()
},start:function(){var a=this;
if(this.queue.length){this.queue.shift()();
setTimeout(function(){a.start()
},0)
}}});
elf.util.extend(union.lib.ExecQueue,{start:function(a,b){new this({queue:a,autoStart:true})
}});
union.lib.Flash={TPL_FLASH_HTML:'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="#{width}" height="#{height}" id="#{id}" align="middle"><param name="allowScriptAccess" value="always"><param name="quality" value="high"><param name="movie" value="#{url}"><param name="wmode" value="#{wmode}"><param name="flashvars" value="#{vars}"><embed wmode="opaque" src="#{url}" flashvars="#{vars}" quality="high" width="#{width}" height="#{height}" name="#{id}" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>',option:{wmode:"opaque"},createHTML:function(b){var a=elf.util.extend({},this.option);
elf.util.extend(a,b);
return elf.util.template(this.TPL_FLASH_HTML,a)
},getMovie:function(a){return document[a]||window[a]
}};
union.lib.CopyButtonFactory={instances:{},create:function(a){var d=document.getElementById(a.buttonId);
if(elf.util.Browser.IE){d.onclick=function(){var e=document.getElementById(a.textId);
e.select();
e.createTextRange().execCommand("Copy");
alert("复制成功！")
}
}else{var c=elf.util.guid(this.TEXT_ID_PREFIX);
d.onmouseover=this._coverButton;
d.setAttribute(this.NAME_BUTTON_LINK_KEY,c);
a.url=this.URL_FLASH_WIDGET;
a.id=c;
a.width="100%";
a.height="100%";
a.wmode="transparent";
a.wrapId=this.getWrapId(c);
var b=document.createElement("div");
b.style.cssText=(new elf.dom.Style({position:"absolute",top:0,left:0,width:"1px",height:"1px",opacity:0,filter:"alpha(opacity=0)"})).toString();
b.innerHTML=union.lib.Flash.createHTML(a);
b.id=this.getWrapId(c);
document.getElementById("MainPage").appendChild(b);
b=null;
a.getPasteData=this._getPasteData;
a.inter=setInterval(function(){var e=union.lib.Flash.getMovie(c);
if(e.flashInit&&e.flashInit()){clearInterval(a.inter);
e.setContentFuncName("union.lib.CopyButtonFactory.instances."+c+".getPasteData")
}},200);
this.instances[c]=a
}},get:function(a){return this.instances[a]
},getWrapId:function(a){return this.TEXT_WRAP_ID_PREFIX+a
},getWrapByKey:function(a){return document.getElementById(this.getWrapId(a))
},_getPasteData:function(){var a=union.lib.CopyButtonFactory.getWrapByKey(this.id);
a.style.top=0;
a.style.left=0;
a.style.width="1px";
a.style.height="1px";
alert("复制成功！");
return document.getElementById(this.textId).value
},_coverButton:function(c){var a=union.lib.CopyButtonFactory;
var d=elf.dom.getPosition(this,document.getElementById("Holder"));
var b=a.getWrapByKey(this.getAttribute(a.NAME_BUTTON_LINK_KEY));
b.style.top=d.y+"px";
b.style.left=d.x+"px";
b.style.width=this.offsetWidth+"px";
b.style.height=this.offsetHeight+"px"
},NAME_BUTTON_LINK_KEY:"data-key",TEXT_ID_PREFIX:"CLF_",TEXT_WRAP_ID_PREFIX:"W_",URL_FLASH_WIDGET:"/un-web-lib/flash/clipboardLayerPlus.swf"};
union.lib.InputMirror=elf.util.Class.create({initialize:function(a){elf.util.extend(this,a);
this.foreachField(this.initEventListener)
},initEventListener:function(a){function b(c){a.synchronize(this.value)
}elf.dom.Event.add(this,"change",b);
elf.dom.Event.add(this,"blur",b)
},foreachField:function(b){for(var a=this.fieldId.length-1;
a>=0;
a--){b.call(document.getElementById(this.fieldId[a]),this)
}},synchronize:function(b){var a=this;
this.foreachField(function(){if(this!==a&&this.value!=b){placeHolder=this.getAttribute("placeholder")||"";
this.value=b;
if((elf.util.Browser.IE||elf.util.Browser.Firefox)&&placeHolder){this.value=b?b:placeHolder;
elf.dom.ClassName.toggle(this,"placeholder",!this.value||this.value==placeHolder)
}a.onSynchronize&&a.onSynchronize(b)
}})
}});
union.lib.InputPlaceHolder=elf.util.Class.create({initialize:function(b){if(!elf.util.Browser.IE&&!elf.util.Browser.Firefox){return null
}elf.util.extend(this,b);
var a=this.getInput();
a.onfocus=function(d){var e=this.value.trim(),c=this.getAttribute("placeholder");
elf.dom.ClassName.remove(this,"placeholder");
if(e==c){this.value=""
}};
a.onblur=function(d){var e=this.value.trim(),c=this.getAttribute("placeholder");
elf.dom.ClassName.toggle(this,"placeholder",!e||e==this.getAttribute("placeholder"));
if(!e){this.value=c
}};
a.onblur();
a=null
},getInput:function(){return document.getElementById(this.inputId)
}});
union.lib.Pager=elf.util.Class.create({initialize:function(a){elf.util.extend(this,a);
var c=this;
var b=this.getWrap();
elf.dom.Event.add(b,"click",function(e){c.onPageChange&&c.onPageChange(this.getAttribute("page"))
},function(e){return e.nodeName=="Q"&&!baidu.dom.hasClass(e,"disabled")&&!baidu.dom.hasClass(e,"on")
});
var d=this.getCombo();
if(d){elf.dom.Event.add(d,"change",function(e){c.onPerPageChange&&c.onPerPageChange(this.value)
})
}},getWrap:function(){return baidu.dom.query("#"+this.wrapId+" .page-control")[0]
},getCombo:function(){return baidu.dom.query("#"+this.wrapId+" select.perpage-select")[0]
},render:function(b,c,a){this.renderPageControl(this.getWrap(),b,c);
if(this.getCombo()){this.renderPerPage(this.getCombo(),a)
}},renderPageControl:function(g,a,h){var b=g.getElementsByTagName("p")[0];
var n='<q page="#{page}"#{extra}>#{text}</q>';
var e='#{prevPage}<span class="page-number">#{firstPage}#{prevEtc}#{curPage}#{nextEtc}#{lastPage}</span>#{nextPage}';
function j(i){return baidu.format(n,i)
}var d={prevPage:"",firstPage:"",prevEtc:"",curPage:"",nextEtc:"",lastPage:"",nextPage:""};
d.prevPage=j({text:"&lt; 上一页",page:h>1&&a>1?a-1:-1,extra:a==1||h<2?' class="btn-pre disabled"':' class="btn-pre"'});
if(a-2>2){d.prevEtc=j({text:"..."})
}d.firstPage=a<=3?"":j({text:1,page:1});
for(var f=a-2;
f<=a+2;
f++){if(1<=f&&f<=h){d.curPage+=j({text:f,page:f})
}}d.lastPage=a+2>=h?"":j({text:h,page:h});
if(a+2<h-1){d.nextEtc=j({text:"..."})
}d.nextPage=j({text:"下一页 &gt;",page:h>1&&a<h?a+1:-1,extra:a==h||h<2?' class="btn-next disabled"':' class="btn-next"'});
b.innerHTML=baidu.format(e,d);
var l=b.getElementsByTagName("span")[0];
var m=g.getElementsByTagName("p")[0].firstChild;
var o=g.getElementsByTagName("p")[0].lastChild;
var k=baidu.dom.children(l);
for(var f=0;
f<k.length;
f++){if(k[f].innerHTML==a){baidu.addClass(k[f],"on")
}}var c=b.getElementsByTagName("q");
for(var f=0;
f<c.length;
f++){if(baidu.dom.getAttr(c[f],"page")!=""&&!baidu.dom.hasClass(c[f],"disabled")&&!baidu.dom.hasClass(c[f],"on")){c[f].onmouseover=function(){baidu.addClass(this,"hover")
};
c[f].onmouseout=function(){baidu.removeClass(this,"hover")
}
}}},renderPerPage:function(c,a){for(var b=0;
b<baidu.dom.children(c).length;
b++){if(c.options[b].value==a){c.options[b].selected=true
}}}});
union.lib.parseDate=function(a){return new Date(a.slice(0,4),a.substr(4,2)-1,a.substr(6,2))
};
union.lib.Popup=elf.util.Class.create({initialize:function(a){elf.util.extend(this,this.constructor.option);
elf.util.extend(this,a)
},getModule:function(){return document.getElementById(this.moduleId)
},getBackground:function(){return document.getElementById(this.backgroundId)
},actNoDelay:function(a){this.showing=a;
var c=this.getModule();
var b=this.getBackground();
var f=this.getRefer();
var e=this.position;
if(b){elf.dom.ClassName.toggle(b,this.backgroundShowClass,a);
this.updateDepth&&a&&f.appendChild(b)
}if(a){var d=c.style.visibility||"";
c.style.visibility="hidden";
elf.dom.ClassName.add(c,this.showClass);
if(e){c.style.left=e.x+"px";
c.style.top=e.y+"px"
}else{if(this.center){this.reposition()
}}c.style.visibility=d;
this.updateDepth&&f.appendChild(c);
this.onShow&&this.onShow.call(c)
}else{elf.dom.ClassName.remove(c,this.showClass);
this.onHide&&this.onHide.call(c)
}},reposition:function(){var a=this.getModule();
var g=this.getRefer();
var d=g.parentNode||g;
var c=d.scrollLeft||0;
var b=d.scrollTop||0;
var f=(d.offsetWidth-a.offsetWidth)/2+c;
var e=(d.offsetHeight-a.offsetHeight)/2+b;
a.style.left=f+"px";
a.style.top=e+"px"
},setPosition:function(a,e){var b=this.getModule();
var c=a,d=e;
if(typeof a=="object"){c=a.x;
d=a.y
}b.style.left=c+"px";
b.style.top=d+"px"
},showNoDelay:function(){this.actNoDelay(true)
},hideNoDelay:function(){this.actNoDelay(false)
},act:function(a,d){var c=this;
this.showing=a;
if(this.timer){clearTimeout(this.timer)
}var b=elf.util.Type.isDefined(d)?d:a?this.showDelay:this.hideDelay;
if(b){this.timer=setTimeout(function(){if(c.showing==a){a?c.showNoDelay():c.hideNoDelay()
}},b)
}else{a?this.showNoDelay():this.hideNoDelay()
}},show:function(a){this.act(true,a)
},hide:function(a){this.act(false,a)
}});
union.lib.Popup.option={getRefer:function(){return document.body
},hideDelay:0,showDelay:0,showing:false,updateDepth:false,showClass:"active",backgroundShowClass:"active",center:true};
union.lib.Dialog=elf.util.Class.create({initialize:function(a){union.lib.Popup.prototype.initialize.call(this,a);
var b=this;
elf.dom.Event.add(this.getModule(),"click",function(c){b.hide()
},function(c){return elf.dom.ClassName.has(c,b.closeButtonClass)
});
elf.dom.Event.add(this.getModule(),"mousedown",function(c){union.lib.Draggable.start({element:b.getModule(),mouseX:c.clientX,mouseY:c.clientY})
},function(c){return elf.dom.ClassName.has(c,b.handelClass)
});
elf.dom.Event.add(document,"mouseup",function(){union.lib.Draggable.stop(b.getModule())
})
}},union.lib.Popup);
elf.util.extend(union.lib.Dialog.option,{closeButtonClass:"close-button",handelClass:"drag-handle"});
union.lib.RuleAdapter={transform:function(g){var c=[];
for(var e=g.length-1;
e>=0;
e--){var d=g[e];
c.unshift({field:d.field,rules:[],exit:{"true":0,"false":-1}});
var a=c[0].rules;
for(var b=d.rule.length-1;
b>=0;
b--){var f=d.rule[b];
if(this.verifierMap[f.name]){a.unshift({method:this.verifierMap[f.name],param:f.param,error:f.error,exit:{"true":0,"false":-1}})
}}}return{rules:c,ultimate:true,exit:{"true":1,"false":-1}}
},verifierMap:{required:function(a){return elf.validation.Verifier.notNull(a)
},requiredstring:function(b,a){var a=a||{};
if(a.trim){b=b.trim()
}return elf.validation.Verifier.notNull(b)
},"int":function(f,d){var b=false;
if(elf.validation.Verifier.isInteger(f)){if(d){var c=typeof d.min!="undefined"?d.min:"";
var a=typeof d.max!="undefined"?d.max:"";
var e="["+c+","+a+"]";
if(elf.validation.Verifier.inRange(f,e)){b=true
}}else{b=true
}}return b
},date:function(e,d){var b=false;
if(elf.validation.Verifier.isDate(e)){if(d){var c=d.min||"";
var a=d.max||"";
if(elf.validation.Verifier.inDateRange(e,{start:c,end:a})){b=true
}}else{b=true
}}return b
},email:function(a){return elf.validation.Verifier.isEmail(a)
},url:function(a){return elf.validation.Verifier.isURL(a)
},regex:function(c,b){var b=b||{};
var a=new RegExp(b.expression||"");
return elf.validation.Verifier.testRegExp(c,a)
},stringlength:function(b,a){var a=a||{};
if(a.trim){b=b.trim()
}return elf.validation.Verifier.lengthBetween(b,a.minLength||0,typeof a.maxLength!="undefined"?a.maxLength:Number.POSITIVE_INFINITY)
}}};
union.lib.StatusController=elf.util.Class.create({initialize:function(a){elf.util.extend(this,a);
this.statusSet=new elf.util.Map(this.statusSet||{});
this.moduleGroup=this.moduleGroup||[];
this.register.apply(this,this.moduleGroup)
},setStatus:function(a,b){this.statusSet.set(a,b)
},getStatus:function(a){return this.statusSet.get(a)
},changeStatus:function(a,b){this.setStatus(a,b);
this.sendStatus&&this.sendStatus(this.statusSet.get())
},register:function(){var c=this;
this.moduleGroup.push.apply(this.moduleGroup,arguments);
for(var b=this.moduleGroup.length-1;
b>=0;
b--){var a=this.moduleGroup[b];
a.onStatusChange=function(d,e){c.changeStatus(d,e)
};
if(a.initStatus){this.setStatus(a.initStatus())
}}},updateStatus:function(a){for(var b=this.moduleGroup.length-1;
b>=0;
b--){var c=this.moduleGroup[b];
c.update&&c.update(a)
}this.statusSet.set(a)
}});
union.lib.TabSwitch=elf.util.Class.create({initialize:function(b){var f=this;
elf.util.extend(this,this.constructor.option);
elf.util.extend(this,b);
var e=this.getTabGroup();
var d=this.getContentGroup();
var a=elf.util.Type.isDefined(this.defaultOn)&&this.defaultOn!=-1;
for(var c=e.length-1;
c>=0;
c--){e[c].setAttribute(this.tabClass,c);
d[c].setAttribute(this.contentClass,c);
if(a){elf.dom.ClassName.remove(e[c],this.tabOnClass);
elf.dom.ClassName.remove(d[c],this.contentActiveClass)
}}elf.dom.Event.add(this.getWrap(),this.activeEvent,function(h){var g=f.getCurrentTab();
if(this!=g){f.switchTo(this);
if(f.onSwitchTab){f.onSwitchTab()
}}},function(g){return elf.dom.ClassName.has(g,f.tabClass)
});
if(a&&e.length&&d.length){elf.dom.ClassName.add(e[this.defaultOn],this.tabOnClass);
elf.dom.ClassName.add(d[this.defaultOn],this.contentActiveClass);
if(f.onSwitchTab){f.onSwitchTab()
}}},getWrap:function(){return document.getElementById(this.wrapId)
},getElementsByClassName:function(a){return elf.dom.query("."+a.replace(/ +/g,"."),this.getWrap())
},getTabGroup:function(){return this.getElementsByClassName(this.tabClass)
},getContentGroup:function(){return this.getElementsByClassName(this.contentClass)
},getCurrentIndex:function(){return parseInt(this.getCurrentTab().getAttribute(this.tabClass))
},getCurrentTab:function(){var a=this.getElementsByClassName(this.tabClass+"."+this.tabOnClass);
return a.length?a[0]:null
},getCurrentContent:function(){var a=this.getElementsByClassName(this.contentClass+"."+this.contentActiveClass);
return a.length?a[0]:null
},switchTo:function(c){var b=this.getCurrentTab();
var d=this.getCurrentContent();
if(b){elf.dom.ClassName.remove(b,this.tabOnClass)
}if(d){elf.dom.ClassName.remove(d,this.contentActiveClass)
}elf.dom.ClassName.add(c,this.tabOnClass);
var a=c.getAttribute(this.tabClass);
d=elf.dom.query("#"+this.wrapId+" ."+this.contentClass+"["+this.contentClass+"="+a+"]")[0];
elf.dom.ClassName.add(d,this.contentActiveClass)
},switchByIndex:function(a){this.switchTo(this.getTabGroup()[a])
}});
union.lib.TabSwitch.option={tabClass:"tab-switch",tabOnClass:"on",contentClass:"tab-content",contentActiveClass:"active",defaultOn:0,activeEvent:"click"};
union.lib.Widget=elf.util.Class.create({initialize:function(a){elf.util.extend(this,a);
this.loadAssets()
},getWrap:function(){return document.getElementById(this.wrapId)
},setHTMLContent:function(a){var b=this.getWrap();
b.innerHTML=a;
if(typeof esui!="undefined"){esui.util.init(b,this.constructor.UI_PROP_MAP)
}},loadAssets:function(){if(this.assets&&this.assets.length){var c=[];
for(var a=this.assets.length-1;
a>=0;
a--){c.unshift(elf.net.LoaderCreator.create(this.assets[a]))
}var b=this;
elf.net.LoaderQueue.load(c,function(){b.onAssetsLoad()
})
}},onAssetsLoad:function(){this.loaded=true;
this.onLoad&&this.onLoad()
}});
union.lib.Widget.ready=function(d,c){for(var b=0,a=d.length;
b<a;
b++){d[b].onLoad=function(){var f=1;
for(var g=0,e=d.length;
g<e;
g++){if(!(f&=d[g].loaded)){break
}}if(f){c()
}}
}};
union.lib.Navigation={initialize:function(a){var b=window.location.href;
if(b.indexOf("admin")<0){this.switchPage()
}},switchPage:function(){var e=document.getElementById("Subnav");
if(e){var c=e.getElementsByTagName("li");
var f=window.location.href;
var a=-1;
for(var d=0;
d<this.urlDataSet.length;
d++){for(var b=0;
b<this.urlDataSet[d].url.length;
b++){if(f.indexOf(this.urlDataSet[d].url[b])>=0){baidu.addClass(c[d],"active");
a=d;
break
}}if(a!=-1){break
}}for(var d=0;
d<c.length;
d++){if(d!=a){baidu.removeClass(c[d],"active")
}}}},urlDataSet:[{index:0,url:["/main/initAccount.action"]},{index:1,url:["/client/#/report/"]},{index:2,url:["/main/cooperation/cooperation.action","/main/cooperation/cpro/cpro!init.action","/main/cooperation/cpro/cpro!getCode.action","/main/cooperation/search/","/main/cooperation/tuan/","/main/cooperation/uap/","/main/cooperation/iknow/","/main/cooperation/software/"]},{index:3,url:["/main/cooperation/adposMgr!show.action","/main/cooperation/cpro/cpro!transformCode.action","/main/cooperation/cpro/cpro!edit.action"]},{index:4,url:["/main/settings/","/client/main/app/"]},{index:5,url:["/cent/"]},{index:6,url:["/finance/"]},{index:7,url:["/main/user/customerInfo!init.action"]},{index:8,url:["/msg/"]},{index:9,url:["/strategy/","/adviceIndex.action"]},{index:10,url:["/quality/"]}]};
union.lib.Support={initialize:function(){var f=union.lib.Support;
var d=document.getElementsByTagName("a");
for(var e=d.length-1;
e>=0;
e--){var b=d[e].getAttribute("supportLink");
if(b){var g=f.data[b];
if(g){var c=f.URL_PREFIX_BASE;
if(g.detailId){d[e].href=c+"detail_"+g.detailId+".html"
}else{if(g.nodeId){d[e].href=c+"node_"+g.nodeId+".html"
}}if(g.text!=""){d[e].innerHTML=g.text
}}}}},data:{}};
union.lib.UserStatus={initialize:function(a){var b=window.location.href;
if(baidu.G("ClientName")!=null&&baidu.G("UnreadMsg")!=null){union.lib.Ajax.loadJSON({url:this.URL_GET_UNREAD,onSuccess:function(f){baidu.G("ClientName").innerHTML=f.customerName;
if(f.unreadMsgNum>0){baidu.G("UnreadMsg").innerHTML='(<span class="hint">'+f.unreadMsgNum+"</span>)"
}else{baidu.G("UnreadMsg").innerHTML=""
}var c=baidu.G("Subnav").getElementsByTagName("li");
for(var d=c.length-1;
d>=0;
d--){if((f.canDivide==1||!baidu.dom.hasAttr(c[d],"canDivide"))&&(f.cpro==1||!baidu.dom.hasAttr(c[d],"hasCpro"))){baidu.addClass(c[d],"show")
}}if(baidu.G("Strategy")&&f.cpro!=1){baidu.G("Strategy").style.display="none"
}if(baidu.G("CproSiteQuality")&&f.cpro!=1){baidu.G("CproSiteQuality").style.display="none"
}if(f.canDivide==1){var e=baidu.G("Cents");
e&&baidu.removeClass(e,"hidden")
}if(f.cpro==1&&f.canDivide==1){var g=baidu.G("CproSiteQuality");
g&&baidu.removeClass(g,"hidden")
}},noLoading:true})
}}};